﻿@using System.Data
@using ZoomLa.Common
@using ZoomLa.BLL
@using ZoomLa.Model
@using ZoomLa.Components
@model ZoomLa.SQLDAL.SQL.PageSetting
@{
    Model.cols = 8;
    Model.url = MVCHelper.GetAction("Content_Data",Request);
}
@functions{
    B_Content conBll = new B_Content();
    B_Model modelBll = new B_Model();
    public string GetUrl(string infoid)
    {
        int p = DataConverter.CLng(infoid);
        M_CommonData cinfo = conBll.GetCommonData(p);
        if (cinfo.IsCreate == 1)
            return SiteConfig.SiteInfo.SiteUrl + cinfo.HtmlLink;
        else
            return "/Page/PageContent?ItemID=" + p;
    }
    public string GetModel(string infoid)
    {
        int p = DataConverter.CLng(infoid);
        M_CommonData cinfo = conBll.GetCommonData(p);

        if (cinfo.ModelID == 0)
        {
            return "";
        }
        else
        {
            return "[" + modelBll.GetModelById(cinfo.ModelID).ItemName + "] ";
        }
    }
    public string GetStatus(DataRow dr)
    {
        return B_Content.GetStatusStr(DataConverter.CLng(dr["Status"]));
    }
    public string GetCteate(string IsCreate)
    {
        int s = DataConverter.CLng(IsCreate);
        if (s != 1)
            return "<font color=red>×</font>";
        else
            return "<font color=green>√</font>";
    }
}
<div id="EGV">
    <table class="table table-striped table-bordered table-hover">
        <tr><th></th><th width="6%">ID</th><th width="45%">标题</th><th>状态</th><th>已生成</th><th>排序</th><th>排序</th><th>操作</th></tr>
        @foreach (DataRow dr in Model.dt.Rows)
        {
        <tr>
            <td>
                <input type="checkbox" name="idchk" value="@dr["GeneralID"]" />
            </td>
            <td>@dr["GeneralID"]</td>
            <td><a href="@GetUrl(dr["GeneralID"].ToString())" target="_blank">@GetModel(dr["GeneralID"].ToString()) @dr["Title"]</a></td>
            <td>@GetStatus(dr)</td>
            <td>@MvcHtmlString.Create(GetCteate(dr["IsCreate"].ToString()))</td>
            <td>
                <input type="text" name="order_T" value="@dr["OrderID"]" onblur="OrderFunc(this);" style="width:50px;text-align:center;" tabindex="1" />
                <input type="hidden" name="order_Hid" value="@(dr["GeneralID"]+":"+dr["OrderID"]+":"+dr["OrderID"])" />
            </td>
            <td>
                <a onclick="UpTr(this)" style="cursor:pointer;">上移</a>|
                <a onclick="DownTr(this)" style="cursor:pointer;">下移</a>
            </td>
            <td>
               @if(Request["status"]=="-2"){
                 <a href="javascript:;" onclick="mvcpage.del({ ids: '@dr["GeneralID"]', url: 'Content_Recover' })">还原</a>
               }
               else
               {
                    <a href="EditContent?GeneralID=@dr["GeneralID"]" target="_parent">修改</a>
                   <a href="javascript:;" onclick="mvcpage.del({ ids: '@dr["GeneralID"]', url: 'content_del', confirm: '确定要移入回收站吗' })">移除</a>
               }
            </td>
        </tr>
        }
        @Html.Partial("_page", Model)
    </table>
</div>